package org.ponly.lpf4j.impl;

import javax.xml.bind.JAXB;
import javax.xml.bind.annotation.*;
import java.net.URL;

/**
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "ponly-plugin")
class PluginBean {
    @XmlAttribute
    private String url;
    @XmlElement(required = true)
    private String id;
    @XmlElement(required = true)
    private String name;
    @XmlElement(required = true)
    private String version;
    @XmlElement
    private String vendor;
    @XmlElement(name = "entrance", required = true, nillable = true)
    private String entrance;
    @XmlElement(name = "depends")
    private String depends;
    @XmlElement(name = "change-notes")
    private String changeNotes;
    @XmlElement
    private String description;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getVendor() {
        return vendor;
    }

    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    public String getChangeNotes() {
        return changeNotes;
    }

    public void setChangeNotes(String changeNotes) {
        this.changeNotes = changeNotes;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getEntrance() {
        return entrance;
    }

    public void setEntrance(String entrance) {
        this.entrance = entrance;
    }

    public String getDepends() {
        return depends;
    }

    public void setDepends(String depends) {
        this.depends = depends;
    }

    public static void main(String[] args) {
        URL url = Thread.currentThread().getContextClassLoader().getResource("META-INF/lpf4j/plugin.xml");
        PluginBean pluginBean = JAXB.unmarshal(url, PluginBean.class);
        System.out.println(pluginBean);
    }
}
